﻿using Com.Lancetinc.Evs.Helpers;
using System;
using System.Windows;

namespace Com.Lancetinc.Evs.Controls
{
    /// <summary>
    /// 医师编辑
    /// </summary>
    public partial class ComboBoxSelectItemsEditUserControl
    {
        #region ItemsTitle
        public static readonly DependencyProperty ItemsTitleProperty =
            DependencyProperty.Register("ItemsTitle", typeof(string), typeof(ComboBoxSelectItemsEditUserControl));

        public string ItemsTitle
        {
            get => (string)GetValue(ItemsTitleProperty);
            set => SetValue(ItemsTitleProperty, value);
        }
        #endregion

        #region ItemsLines

        public string ItemsLines
        {
            get => CtrlItemsLines.Text;
            set
            {
                CtrlItemsLines.Text = value;
                if (_initItemLines == null)
                    _initItemLines = value;
            }

        }
        #endregion

        public string ItemsTip => I18nHelper.Default.GetMessage("ComboBoxSelectItemsEditUserControl.Tips") + ItemsTitle;

        public ComboBoxSelectItemsEditUserControl()
        {
            InitializeComponent();
            this.DataContext = this;
        }

        private string _initItemLines = null;


        public bool CheckChanged()
        {
            return ItemsLines != _initItemLines;
        }

        public void AcceptChanges()
        {
            _initItemLines = ItemsLines;
        }
    }
}
